<%@ page import="java.util.List" %>
<%@ page import="R.Entity.Diagnosis" %>
<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<!doctype html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>查询显示病人</title>
        <link rel="stylesheet" href="/res/css/RegShowAll.css" type="text/css"/>
    </head>
    <body>
        <p>查询诊断信息</p>
        <form action="/SickShowAll" method="post">
            <div id="div2">就诊卡号：<input type="text" name="card_number"/></div>
            <div id="div3">药品编号<input type="text" name="record_number"/></div>
            <div id="div4">姓名<input type="text" name="patient_name"/></div>
            <input type="submit" value="查询"/>
            <button><a href="/R/sickAdd.jsp">新增就诊记录</a></button>
        </form>
        <table border="0" frame=hsides>
            <tr>
                <th>就诊卡号</th>
                <th>药品编号</th>
                <th>姓名</th>
                <th>查看详细</th>
                <th>附加下载</th>
                <th>操作</th>
            </tr>
            <%
                List<Diagnosis> list = (List<Diagnosis>) request.getAttribute("SickList");
                if (list != null) {
                    for (int i = 0; i < list.size(); i++) {
                        Diagnosis r = list.get(i);
                        out.println("<tr>");
                        out.println("<td>" + r.getCard_number() + "</td>");//就诊卡号
                        out.println("<td>" + r.getRecord_number() + "</td>");//病历编号
                        out.println("<td>" + r.getPatient_name() + "</td>");//姓名
                        out.println("<td><a href='/minute?card_number="+r.getCard_number()+"&record_number="+r.getRecord_number()+"'>>详细</a></td>");//查看详细
                        out.println("<td><a href=''>下载</a></td>");//附加下载
                        out.println("<td><a href='/SickEditServlet?card_number="+r.getCard_number()+"&record_number="+r.getRecord_number()+"'>修改</a>&nbsp;&nbsp;");
                        out.println("<a href='/SickDelServlet?card_number="+r.getCard_number()+"&record_number="+r.getRecord_number()+"'>删除</a></td>");
                        out.println("</tr>");
                    }
                }
            %>
        </table>
    </body>
</html>